#include <iostream>
using namespace std;
const int N = 200005;
int n, k, x;
int a[N];
int main(){
	cin >> n >> k >> x;
	for (int i = 0; i < n; i++) cin >> a[i];
	if (x != 0) k %= x;
	for (int i = x - k; i < x; i++) cout << a[i] << " ";
	for (int i = 0; i < x - k; i++) cout << a[i] << " ";
	for (int i = x; i < n; i++) cout << a[i] << " ";

	

    return 0;
}


